﻿@{
    ViewBag.Title = "Mở khóa học";
    Layout = "~/Views/Shared/FrontEndMasterLayout.cshtml";        
}
@using DLULearningNetworkModel
@model DLULearningNetworkModel.Course
@section cssjs{
    <link rel="Stylesheet" type="text/css" href="../../Content/Site.css" />
    <link rel="Stylesheet" type="text/css" href="../../Content/icon.css" />    
    <link rel="Stylesheet" type="text/css" href="../../Content/base/jquery-ui-1.8.16.custom.css" /> 
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.8.16.custom.min.js"></script>    
    <script type="text/javascript" src="../../Scripts/Custom/jsCourse.js"></script>    
    <script type="text/javascript" src="../../Scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            CreateCourse.init();
            $(".datetimePicker").datepicker({
                dateFormat: "dd/mm/yy",                
                changeMonth: true,
                changeYear:true,
                constrainInput: true,
                minDate: new Date(@DateTime.Now.Year,@DateTime.Now.Month-1,@DateTime.Now.Day),                
                autoSize: true
            });
        });
    </script>
    <style type="text/css">
        #ChosenFiles div
        {
            background-color: #dffce2;
            margin-top: 2px;
            padding: 0 3px 0 3px;
        }
    </style>
}
@section rightColumn{
<div style="width:730px;">
    <div class="TieuDe">
        Mở khóa học
    </div>
    <div id="dialog">
        <div id="dialog-loading" class="loading">
        </div>
    </div>
    @using (Html.BeginForm()){
    if (ViewBag.CreateCourseMessage != null)
    {
        <div class="box_error" style="display:block;">@ViewBag.CreateCourseMessage</div>
    }
    <table class="tbl1" cellspacing="10px">
        <tr>
            <td style="width: 100px;">
                Tiêu đề
            </td>
            <td>
                @Html.TextBoxFor(m => m.Title_s, new { style = "height:22px; width:300px;" })
                @Html.ValidationMessageFor(m => m.Title_s)
            </td>
        </tr>
        <tr>
            <td>
                Lĩnh vực
            </td>
            <td>
                @{
           List<Category> categories = Category.GetAll();                   
                }
                @for (int i = 0; i < categories.Count; i++)
                {
                    <div class="checkboxContain">
                        @if (i == 0)
                        {
                            @Html.RadioButtonFor(m => m.CategoryID_u, categories[i].CategoryID_u, new { @checked = "checked" })
                        }
                        else
                        {
                            @Html.RadioButtonFor(m => m.CategoryID_u, categories[i].CategoryID_u)
                        }
                        <span>@categories[i].Name_s</span>
                    </div>
                }
            </td>
        </tr>
        <tr>
            <td>
                Tài nguyên
            </td>
            <td>
                <span id="ChooseExistFiles">Chọn tài nguyên có sẵn: <a class="personal_icon36" href="#">
                    Cá nhân</a> <a class="public_icon36" style="padding-left: 44px; margin-left: 10px;"
                        href="#">Cộng đồng</a> </span>
                <br />
                <div id="ChosenFiles" style="width: 546px; overflow: hidden;">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                Mô tả
            </td>
            <td>
                @Html.TextAreaFor(m => m.Description_s, new { style = "width:100%; height:70px; resize:none;" })                
            </td>
        </tr>
        <tr>
            <td>
                Thời gian
            </td>
            <td>
                Từ  @Html.EditorFor(m => m.StartDate_dt)  đến  @Html.EditorFor(m => m.EndDate_dt)
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <input class="button" type="submit" value="Mở khóa học" />
            </td>
        </tr>
    </table>
    }
</div>
}
